package com.stock.core.task;

import com.stock.api.service.stock.BusinessHistoryService;
import com.stock.comm.util.DateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>股票业务任务</p>
 *
 * @author 张峰 zfvip_it@163.com
 * @createTime: 2016/9/14 11:43
 */
@Service("businessHistoryTask")
public class BusinessHistoryTask extends BaseTask {

    private static final Logger LOGGER = LoggerFactory.getLogger(BusinessHistoryTask.class);

    @Resource
    private BusinessHistoryService businessHistoryService;

    /**
     * 定时任务处理
     */
    public void run() throws Exception {
        LOGGER.info("股票业务分析任务开始···");
        String startDate = DateUtil.getCurrentDatetime();
        businessHistoryService.startStockBusinessData();
        String endDate = DateUtil.getCurrentDatetime();
        LOGGER.info("股票业务分析任务耗时：" + DateUtil.dateDiff(startDate, endDate));
    }
}
